package com.mycar2w.cloud.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;

/**
 * created time 2017/4/1
 *
 * @author ljc
 * @version V1.0
 */
@Entity
@Table(name = "t_transaction", schema = "mycar2wnew", catalog = "")
public class TTransaction {
    private Timestamp createTime;
    private Long carId;
    private Long buyUserId;
    private Long saleUserId;
    private Long id;

    @Basic
    @Column(name = "create_time", nullable = false)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "car_id", nullable = false)
    public Long getCarId() {
        return carId;
    }

    public void setCarId(Long carId) {
        this.carId = carId;
    }

    @Basic
    @Column(name = "buy_user_id", nullable = false)
    public Long getBuyUserId() {
        return buyUserId;
    }

    public void setBuyUserId(Long buyUserId) {
        this.buyUserId = buyUserId;
    }

    @Basic
    @Column(name = "sale_user_id", nullable = false)
    public Long getSaleUserId() {
        return saleUserId;
    }

    public void setSaleUserId(Long saleUserId) {
        this.saleUserId = saleUserId;
    }

    @Id
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TTransaction that = (TTransaction) o;

        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (carId != null ? !carId.equals(that.carId) : that.carId != null) return false;
        if (buyUserId != null ? !buyUserId.equals(that.buyUserId) : that.buyUserId != null) return false;
        if (saleUserId != null ? !saleUserId.equals(that.saleUserId) : that.saleUserId != null) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = createTime != null ? createTime.hashCode() : 0;
        result = 31 * result + (carId != null ? carId.hashCode() : 0);
        result = 31 * result + (buyUserId != null ? buyUserId.hashCode() : 0);
        result = 31 * result + (saleUserId != null ? saleUserId.hashCode() : 0);
        result = 31 * result + (id != null ? id.hashCode() : 0);
        return result;
    }
}
